package com.hcandtx.Bms.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hcandtx.Bms.bean.User;
import com.hcandtx.Bms.mapper.UserMapper;
import com.hcandtx.Bms.service.IUserService;

@Service("userService")
public class UserServiceImpl implements IUserService {
	
	@Autowired
	private UserMapper userMapper;
	
	public User findById(int id) {
		
		return userMapper.findById(id);
	}

	public User login(String loginName, String loginPswd) {
	
		return userMapper.login(loginName, loginPswd);
	}

	@Override
	public int register(User user) {
		
		return userMapper.register(user);
		
	}

	@Override
	public List<User> findAll() {
		
		return  userMapper.findAll();
	}

	@Override
	public int deleteUser(int id) {
	
		return userMapper.deleteUser(id);
	}

	@Override
	public int updateUser(User UserUpdateList) {
	
		return userMapper.updateUser(UserUpdateList);
	}

	@Override
	public List<User> search(String search) {
		// TODO Auto-generated method stub
		return userMapper.search(search);
	}

}
